package cn.codesea.housework_user.net;

import java.util.concurrent.TimeUnit;

import cn.codesea.housework_user.NetConfig;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class ServiceGenerator {

    private static final String SERVER_BASE_URL = NetConfig.SERVER_BASE_URL;

    private static Retrofit retrofit = new Retrofit.Builder().baseUrl(SERVER_BASE_URL).addConverterFactory(GsonConverterFactory.create()).build();

    public static <S> S createService(Class<S> serviceClass) {
        return retrofit.create(serviceClass);
    }

}
